<template>
  <div class="member-home">
    <!-- 概览 -->
    <HomeOverView></HomeOverView>
    <!-- 我的收藏 -->
    <HomePanel title="我的收藏">
      <!-- 默认插槽 -->
      <GoodsItem v-for="item in collectData" :key="item.id" :good="item" />
    </HomePanel>
    <!-- 我的足迹 -->
    <HomePanel title="我的足迹">
      <!-- 默认插槽 -->
      <GoodsItem v-for="item in  browseHistoryData" :key="item.id" :good="item" />
    </HomePanel>
    <!-- 同类商品推荐 -->
    <GoodsRelevant />
  </div>
</template>
<script setup>
import HomeOverView from './components/home-overview.vue'
import GoodsRelevant from '@/views/product/components/goods-relevant.vue'
import HomePanel from './components/home-panel.vue'
import GoodsItem from '@/views/cate/components/goods-item.vue'
import { ref } from 'vue'
import { getBrowseHistory, getCollect } from '@/api/order'
// 我的收藏
const collectData = ref(null)
// 我的足迹
const browseHistoryData = ref(null)
getCollect().then(data => {
  collectData.value = data.result.items
  console.log(data.result)
})
getBrowseHistory().then(data => {
  browseHistoryData.value = data.result.items
  console.log(data.result)
})

</script>
<style lang='less' scoped>
:deep(.xtx-carousel) .carousel-btn.prev {
  left: 5px;
}

:deep(.xtx-carousel) .carousel-btn.next {
  right: 5px;
}
</style>